package com.rongji.cms.tools.es.mapper.mapstruct;

import com.rongji.cms.tools.es.domain.dto.CmsArticleDto;
import com.rongji.cms.tools.es.domain.entity.CmsArticle;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 用mapStruct转换cms传过来的dt转成es用的entity
 */
@Mapper
public interface ICmsArticleMapper {
    ICmsArticleMapper INSTACT = Mappers.getMapper(ICmsArticleMapper.class);

    /**
     * 单个转换
     *
     * @param cmsArticleDto
     * @return
     */
    CmsArticle dto2Entity(CmsArticleDto cmsArticleDto);

    /**
     * list转换
     *
     * @param cmsArticleDtoList
     * @return
     */
    List<CmsArticle> listConvert(List<CmsArticleDto> cmsArticleDtoList);
}
